package cn.lefull.config.fegin;

import feign.RequestInterceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Fegin的Header支持配置
 * @author created by Singer email:313402703@qq.com
 * @time 2018/10/10
 * @description
 */
@Configuration
public class FeignHeaderSupporter {


    @Value("${sign.key}")
    private String key;

    /**
     * 返回请求拦截器
     * @return
     */
    @Bean
    public RequestInterceptor getRequestInterceptor(){
        return new RequestHeaderInterceptor(key);
    }

}
